package com.jack006.algorithmi.day1;

import java.util.Scanner;

/**
 * @Classname B1001
 * @Description 害死人不偿命的 3N+1 猜想
 * @Date 2021-07-04 22:31
 * @Created by jack
 */
public class B1001 {


    public static int getSteps(int num) {
        int count = 0;
        if (num %2 == 0) {
            // 偶数
            count = num / 2;
        } else {
            // 奇数
            count = ((3*num)+1)/2;
        }
        return count;
    }

    public static void main(String[] args) {
        System.out.println("=======请输入一个自然数==========");
        Scanner  in = new Scanner(System.in);
        int next = in.nextInt();
        int step = getSteps(next);
        System.out.println(step);
    }
}
